﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using WestWorldRemake.Characters;
using WestWorldRemake.Messaging;

namespace WestWorldRemake.States
{
    class CreepyStates
    {
        public class CreepyGlobalState : State<Creepy>
        {
            private CreepyGlobalState() { }
            private static CreepyGlobalState _Instance;

            public static CreepyGlobalState Instance
            {
                get
                {
                    if (_Instance == null)
                        _Instance = new CreepyGlobalState();
                    return _Instance;
                }
            }

            public override void Enter(Creepy entity)
            {
            }
            public override void Execute(Creepy entity)
            {
                entity.StateMachine.ChangeState(Worship.Instance);
            }
            public override void Exit(Creepy entity)
            {
            }

            public override Iffy OnMessage(Creepy entity, Telegram t)
            {
                return Iffy.No;
            }
        }
        public class Worship : State<Creepy>
        {
            private Worship() { }
            private static Worship _Instance;

            public static Worship Instance
            {
                get
                {
                    if (_Instance == null)
                        _Instance = new Worship();
                    return _Instance;
                }
            }

            public override void Enter(Creepy entity)
            {
            }
            public override void Execute(Creepy entity)
            {
                entity.Location = LocationType.Downtown;
                Utilities.WriteText(entity, "In his house at R'lyeh dead Cthulhu waits dreaming");
                entity.IncreaseDevoutness(1.0);
            }
            public override void Exit(Creepy entity)
            {
            }

            public override Iffy OnMessage(Creepy entity, Telegram t)
            {
                return Iffy.No;
            }
        }
    }
}
